package com.luchao.springbootdubbo.dubbocustomer;

import com.alibaba.dubbo.config.annotation.Reference;
import com.luchao.springbootdubbo.dubboapi.service.HelloService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {

    @Reference //dubbo 引用服务
    private HelloService helloService;

    @GetMapping("/sayHello")
    private String sayHello(@RequestParam String name) {
        System.out.println("-----/sayHello-------------");
        return helloService.sayHello(name);
    }
}
